import { Component, OnInit } from '@angular/core';
import {ReviewService} from '../../services/review.service';

@Component({
  selector: 'app-reviews-list',
  templateUrl: './reviews-list.component.html',
  styleUrls: ['./reviews-list.component.scss']
})
export class ReviewsListComponent implements OnInit {

  reviews: any;

  constructor(private reviewService: ReviewService) { }

  ngOnInit(): void {
    this.readReviews();
  }

  readReviews(): void {
    this.reviewService.readAll().subscribe(
      response => {
        this.reviews = response;
        console.log(response);
      },
      error => {
        console.log(error);
      }
    );
  }

}
